<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body style="height:2000px;">
<script>
//	var t=setTimeout(function(){
//		alert(1);
//		clearInterval(t);	
//	},1000)

//用setTimeout模拟setInterval函数
//setTimeout(fun,2000);
//var num=0;
//function fun(){
//	num++;
//	alert(num);	
//	
//	setTimeout(fun,2000);
//
//};
var flag=0;
var t=null;
window.ondblclick=function(){
	flag++;
	t=setTimeout(fun,60);
	function fun(){
		if(flag%2!=0){
			window.scrollBy(0,10);
			t=setTimeout(fun,60);
		}else{
			clearTimeout(t);
		};
		
	};	
};

</script>
</body>
</html>
